<template>
  <div>
    <el-button type="success" @click="show=!show">切换显示</el-button>
    <template v-for="(v, k) in defaultMapping" >
      <div v-if="show">
        <span style="color: red">{{k}}</span> -> <span :style="`color: ${correctMapping[k] ? 'orange' : 'green'}`">{{correctMapping[k] ? correctMapping[k] : v}}</span>
      </div>
    </template>
  </div>
</template>

<script>
import {m,f} from "@/store/yg/common/local"
export default {
  props: ['row', 'data', 'more'],
  data() {
    return {
      show: false
    }
  },
  computed: {
    defaultMapping() {
      return this.data.defaultMapping;
    },
    correctMapping() {
      let fields = [];
      if ( ! this.data.source) {
        return fields;
      }
      let d = JSON.parse(this.data.source);
      for (let i in d) {
        fields[d[i].mysqlField] = d[i].mongodbField;
      }
      return fields;
    }
  },
  methods: {
    m(k) {
      return m(k);
    },
    
  }
}

</script>
<style>
</style>
